<?php
/**
 * +----------------------------------------------------------------------
 * | 会员管理模型
 */
namespace app\model;

// 引入框架内置类
use think\facade\Db;
use think\model;

class Article extends Model
{
    // 定义时间戳字段名
    protected $createTime = 'create_time';
    protected $updateTime = 'update_time';
    protected $table = 'article';

    protected $type = [
        'time'=>'timestamp'
    ];


    public static function getList($offset = 0,$limit = 10){
        $res = self::limit($offset,$limit)->order('time','desc')->select();
        return $res;
    }

    public static function getInfoByUid($uid){
        $res = self::where('user_id',$uid)->select();
        return $res;
    }

    public static function getInfoById($id){
        $res = self::where('id',$id)->find();
        return $res;
    }

}
